databaseChangeLog:
  - changeSet:
      id: 1676980939478-1
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - createSequence:
            incrementBy: 50
            sequenceName: seq_user_details
            startValue: 1
  - changeSet:
      id: 1676980939478-2
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - createSequence:
            incrementBy: 50
            sequenceName: seq_users
            startValue: 1
  - changeSet:
      id: 1676980939478-3
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - createTable:
            tableName: user_details
            columns:
              - column:
                  name: id
                  type: BIGINT
                  autoIncrement: true
                  constraints:
                    nullable: false
                    primaryKey: true
                    primaryKeyName: pk_user_details
              - column:
                  name: telegram_id
                  type: VARCHAR(255)
                  constraints:
                    nullable: false
              - column:
                  name: mobile_phone
                  type: VARCHAR(30)
              - column:
                  name: user_id
                  type: BIGINT
  - changeSet:
      id: 1676980939478-4
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - createTable:
            tableName: users
            columns:
              - column:
                  name: id
                  type: BIGINT
                  autoIncrement: true
                  constraints:
                    nullable: false
                    primaryKey: true
                    primaryKeyName: pk_users
              - column:
                  name: first_name
                  type: VARCHAR(30)
                  constraints:
                    nullable: false
              - column:
                  name: last_name
                  type: VARCHAR(30)
                  constraints:
                    nullable: false
              - column:
                  constraints:
                    nullable: false
                  name: email
                  type: VARCHAR(50)
              - column:
                  name: user_details_id
                  type: BIGINT
  - changeSet:
      id: 1676980939478-5
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - addUniqueConstraint:
            tableName: users
            columnNames: email
            constraintName: uc_users_email
  - changeSet:
      id: 1676980939478-6
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - addForeignKeyConstraint:
            baseColumnNames: user_details_id
            baseTableName: users
            constraintName: FK_USERS_ON_USER_DETAILS
            referencedColumnNames: id
            referencedTableName: user_details
  - changeSet:
      id: 1676980939478-7
      author: Viktoria
      objectQuotingStrategy: QUOTE_ONLY_RESERVED_WORDS
      changes:
        - addForeignKeyConstraint:
            baseColumnNames: user_id
            baseTableName: user_details
            constraintName: FK_USER_DETAILS_ON_USER
            referencedColumnNames: id
            referencedTableName: users
